#define _CRT_SECURE_NO_WARNINGS
#define _CRT_SECURE_NO_WARNINGS
#include "stdio.h"
#include "string.h"
#include "stdlib.h"

void main()
{
	int i = 0;
	FILE *fp = NULL;
	char a[100] = "huangliang";

	//char *fname = "c:\\1.txt";
	//char *fname = "c:/a1.txt"; //统一的用45度斜杠
	char *fname = "tmp.txt";
	fp = fopen(fname, "w"); //r+ 读写文件，文件必须存在
	if (NULL == fp)
	{
		printf("func fopen（） err: %s \n", fname);
		return ;
	}

	fputs(a, fp);

	if (fp != NULL)
	{
		fclose(fp);
	}

}
